package com.adong.service.impl;

import com.adong.gmall.bean.UserAddress;
import com.adong.gmall.service.OrderService;
import com.adong.gmall.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 1.让服务提供者注册到注册中心
 * 1.导入dubbo依赖 ,zookeeper的客户端
 * 2.配置服务提供者
 * 2.让服务消费者去注册中心订阅服务提供者的服务地址
 *
 * @author adong
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    UserService userService;

    public List<UserAddress> initOrder(String userId) {
        System.out.println("用户的id：" + userId);
        //查询用户的地址
        List<UserAddress> userAddressList = userService.getUserAddressList(userId);
        for (UserAddress userAddress : userAddressList) {
            System.out.println(userAddress.getUserAddress());
        }
        return userAddressList;
    }
}
